<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>百叶窗demo</title>
		<style>
			html,body{
				width: 100%;
				height: 100%;
				background-color: cadetblue;
				margin: 0;
			}			
			.box{
				margin: 100px auto;
				width: 658px;
				height: 370px;
				border: 2px solid peru;
				position: relative;
			}
			.box .sec1{
				height: 100%;
				width: 100%;
			}
			.box .part{
				position: absolute;
				overflow: hidden;
				width: 50%;
				height: 50%;
				
			}
			.box .top{
				top: 0;
				transition: transform 1s;
			}
			.box .bottom{
				bottom: 0;
				transition: transform 1s .2s;
			}
			.box .left{
				left: 0;
			}
			.box .right{
				right: 0;
			}
			.box .part:before{
				position: absolute;
				background-image: url(img/2222.jpg);
				content: "";
				display: block;
				width: 200%;
				height: 200%;
			}
			.box .part2:before{
				right: 0;
			}
			.box .part3:before{
				bottom: 0;
			}
			.box .part4:before{
				right: 0;
				bottom: 0;
			}
			
			.box .bar{
				margin: 0;
				padding: 0;
				list-style: none;
				position: absolute;
				font-size: 26px;
				color: white;
				left: 50%;
				margin-left: calc(-0.6em);/*有待改进，改成相对于ul宽的*/
				bottom: 1em;
				z-index: 100;
				text-align: center;
			}
			.box .bar label{
				display: inline-block;
				width: 1.2em;
				height: 1.2em;
				line-height: 1.2em;
				border-radius: 0.6em;
				background-color: grey;
			}
			.box .bar input{
				display: none;
			}
			.box .bar input:checked{
				
			}
			.bar1-{
				position: absolute;
				z-index: 22;
				font-size: 26px;
				display: inline-block;
				width: 1.2em;
				height: 1.2em;
				line-height: 1.2em;
				text-align: center;
				border-radius: 0.6em;
				background-color: grey;
				color: white;
			}
			#bar1{
				display: none;
			}
			input:checked ~ .sec1 .left{
				transform: translateX(-100%) translateY(-100%);
			}
			input:checked ~ .sec1 .left.bottom{
				transform: translateX(-100%) translateY(100%);
			}
			input:checked ~ .sec1 .right{
				transform: translateX(100%) translateY(-100%);
			}
			input:checked ~ .sec1 .right.bottom{
				transform: translateX(100%) translateY(100%);
			}
		</style>
	</head>
	<body>
		<div class="box">
			<label for="bar1" class="bar1-">1</label>
			<input type="checkbox" name="" id="bar1" value="1" />
			<div class="sec1">
				<div class="part part1 top left"></div>
				<div class="part part2 top right"></div>
				<div class="part part3 bottom left"></div>
				<div class="part part4 bottom right"></div>
			</div>
			
			
			<ul class="bar">
				<label for="bar1">1</label>
				<input type="checkbox" name="" id="bar1" value="1" />
			</ul>
		</div>
	</body>
</html>
